package com.chenjun.core.dao.generator.mapper;

import com.chenjun.core.dao.generator.entity.OaDictAttnEqpt;
import com.chenjun.core.dao.generator.entity.OaDictAttnEqptExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OaDictAttnEqptMapper {
    @Delete({
        "delete from oa_dict_attn_eqpt",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into oa_dict_attn_eqpt (id, code, ",
        "name, status, create_time, ",
        "update_time, operator, ",
        "note, attn_eqpt_ip, ",
        "last_gather_time, gather_user_id, ",
        "gather_user_name)",
        "values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, ",
        "#{name,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{operator,jdbcType=INTEGER}, ",
        "#{note,jdbcType=VARCHAR}, #{attnEqptIp,jdbcType=VARCHAR}, ",
        "#{lastGatherTime,jdbcType=TIMESTAMP}, #{gatherUserId,jdbcType=VARCHAR}, ",
        "#{gatherUserName,jdbcType=VARCHAR})"
    })
    int insert(OaDictAttnEqpt record);

    int insertSelective(OaDictAttnEqpt record);

    List<OaDictAttnEqpt> selectByExample(OaDictAttnEqptExample example);

    @Select({
        "select",
        "id, code, name, status, create_time, update_time, operator, note, attn_eqpt_ip, ",
        "last_gather_time, gather_user_id, gather_user_name",
        "from oa_dict_attn_eqpt",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    OaDictAttnEqpt selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(OaDictAttnEqpt record);

    @Update({
        "update oa_dict_attn_eqpt",
        "set code = #{code,jdbcType=VARCHAR},",
          "name = #{name,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "operator = #{operator,jdbcType=INTEGER},",
          "note = #{note,jdbcType=VARCHAR},",
          "attn_eqpt_ip = #{attnEqptIp,jdbcType=VARCHAR},",
          "last_gather_time = #{lastGatherTime,jdbcType=TIMESTAMP},",
          "gather_user_id = #{gatherUserId,jdbcType=VARCHAR},",
          "gather_user_name = #{gatherUserName,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(OaDictAttnEqpt record);
}